@extends('member.member')

@section('title', '我的评论')

@section('rightcontainer')
<script src="{{ asset('/js/admin.js') }}"></script>
<div id="wendang" style="background: white;width: 993px; margin-top: 20px;">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <th>所属文章</th>
                <th>评论内容</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($comments as $res)
            <tr id="news_{{ $res->comment_id }}">
                <td>{{ $res->comment_id }}</td>
                @if( $res->app_table == 'teaches')
                <td> @if(!empty($res->teaches))<a href="{{ url('/teaches/'.$res->teaches->id)}} " title="{{$res->teaches->name}}">{{ str_limit($res->teaches->name,20) }} </a>@else 文章已删除 @endif</td>
                @elseif($res->app_table == 'tcompany')
                <td>@if(!empty($res->teaches))<a href="{{url('/teaches/company/show/'.$res->teachesc->id)}}" title="{{$res->teachesc->name}}">{{ str_limit($res->teachesc->name,20) }}</a>@else 文章已删除 @endif</td>
                @elseif($res->app_table == 'tcourse')
                <td>@if(!empty($res->teaches))<a href="{{ url('/teaches/study/'.$res->teachescc->id) }}" title="{{$res->teachescc->name}}">{{ str_limit($res->teachescc->name,20) }}</a> @else 文章已删除 @endif</td>
                @endif
                <td><a href="javascript:void(0)"  onclick="showComment('{{$res->content}}')">{{ str_limit($res->content,20) }}</a></td>
                <td>{{ $res->updated_at}}</td>
                <td>
                    <a href="javascript:void(0);" onclick="del_one('/admin/teaches/comment/delete','{{$res->comment_id}}','{{csrf_token()}}','comment_id')">
                        <i class="glyphicon glyphicon-remove-sign"></i>
                    </a>
                </td>
            </tr>
            @endforeach
            </tbody>
        </table>
    </div>
    <div class="paginate">{!! $comments->render() !!} </div>
</div>

@stop

@section('footer')
@parent
@stop

